<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLeagueMatchesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('matches', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('league_id',false,true)->default(0)->comment('联赛id');
            $table->string('session',8)->default(0)->comment('期数');
            $table->string('number',3)->default('')->comment('序号');
            $table->string('host',30)->default(0)->comment('期数');
            $table->string('guest',30)->default(0)->comment('期数');
            $table->integer('balls')->defualt(1)->comment('让球数');
            $table->string('score',8)->default(0)->comment('期数');
            $table->string('sp1',20)->defualt('')->comment('不让球');
            $table->string('sp2',20)->defualt('')->comment('让球');
            $table->string('result',5)->default('')->comment('结果,1胜,2平,3负,4让胜,5让平,6让负');
            $table->string('odds',11)->default('')->comment('结果赔率');
            $table->tinyInteger('status')->default(2)->comment('状态，-1删除,0中止,1完成,2未完成');
            $table->string('die_time',16)->default('')->comment('投注结束时间');
            $table->timestamps();
            $table->index('session');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `matches` comment '比赛数据'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('matches');
    }
}
